home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / Pxlexplr.pxL < prev    next >
Text File  |  2000-12-23  |  11KB  |  347 lines

  1. Initialize:
  2.     Title$ = "PiXCL + Win95/NT Explorer"
  3.     UseCaption(Title$)
  4.     UseCoordinates(PIXEL)
  5.     SetColorPalette(BITMAP)
  6.     UseBackground(TRANSPARENT,166,166,166)
  7.     DrawBackground
  8.     WinLocate(Title$,500,200,990,400,Res)
  9.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  10.     DirGet(SourceDir$)
  11.  
  12.     WinShow(Title$,TOPMOST,Res)
  13.     InfoMenu(REMOVE)
  14.     WaitInput(100)
  15.     SetMenu("E&xit!",Leave,
  16.         ENDPOPUP,
  17.         "&Explorer",IGNORE,
  18.         "&DDE Init", Start_Explorer_DDE,
  19.         "&Requests",Requests_DDE,
  20.         "&FindFolder",FindFolder_DDE,
  21.         "&ExploreFolder",ExploreFolder_DDE,
  22.         "&ViewFolder",ViewFolder_DDE,
  23.         "F&indFile",FindFile_DDE,
  24.         ENDPOPUP,
  25.         "&Test Apps",IGNORE,
  26.         "&Access 97",Test_MSAccess,
  27.         "&Excel 97",Test_MSExcel,
  28.         "&Netscape",Test_Netscape,
  29.         ENDPOPUP,
  30.         "MS-Access Tests",AccessSpecific,
  31.         ENDPOPUP)
  32.  
  33.         ChangeMenuItem("&FindFolder",GRAY,Res)
  34.         ChangeMenuItem("F&indFile",GRAY,Res)
  35.         ChangeMenuItem("&ExploreFolder",GRAY,Res)
  36.         ChangeMenuItem("&ViewFolder",GRAY,Res)
  37.  
  38.  
  39. Wait_for_Input: 
  40.     WaitInput()
  41.  
  42.  
  43. Leave:    {time to clean up after ourselves...we MUST clear the channel or Explorer 
  44.     is left hanging. Windows stil runs, but DDE inits fail, and rebooting is the only solution.}
  45.  
  46.     If ChanNum <> 0 Then DDETerminate(ChanNum)
  47.     WinClose("Find: All Files",Res)
  48.     WaitInput(200)
  49.     WinExist("Find: All Files",Res)
  50.     If Res = 1 Then Goto Leave
  51.     End
  52.  
  53. Test_Netscape:
  54.     DDEInitiate("Netscape","WWW_OpenURL",ChanNum)
  55.     DDEExecute(ChanNum,"file:///F|/HTML/welcome.htm",Res)
  56.  
  57.     Goto Wait_for_Input
  58.  
  59. AccessSpecific:
  60.     DrawBackground
  61.     If ChanNum <> 0 Then DDETerminate(ChanNum)
  62.     DDEInitiate("MSAccess","System",ChanNum)
  63.     If ChanNum = 0 
  64.         DrawText(10,10,"DDE initiate failed")
  65.         DrawText(10,25,"Access may need to be started.")
  66.     Else
  67.         DrawText(10,10,"DDE conversation initiated")
  68.  
  69.        DDEExecute(ChanNum," [OpenDatabase D:\temp\Address Book1.mdb]",Res)
  70.        If Res = 0
  71.            MessageBox(OK,1,EXCLAMATION,"Failed","DDEexecute",Res)
  72.         Else
  73.             MessageBox(OK,1,INFORMATION,"Selected Database started","DDEExecute",Res)
  74.         Endif
  75.     
  76.         DDEInitiate("MSAccess","Address Book1",ChanNum1)
  77.         DDERequest(ChanNum1,"TableList",Res$)
  78.         MessageBox(OK,1,INFORMATION,Res$,"DataBase 'TableList' Return",Res)
  79.  
  80.         DDERequest(ChanNum1,"ReportList",Res$)
  81.         MessageBox(OK,1,INFORMATION,Res$,"DataBase 'ReportList' Return",Res)
  82.     
  83.         DDERequest(ChanNum1,"MacroList",Res$)
  84.         MessageBox(OK,1,INFORMATION,Res$,"DataBase 'MacroList' Return",Res)
  85.  
  86.         DDEExecute(ChanNum1,"StartPiXCLViewer",Res)
  87.         Res = 0
  88.         While Res = 0
  89.             WaitInput(300)
  90.             WinExist("PiXCL 4.1 Image Processing",Res)
  91.         EndWhile {could also use the PXLResumeAt command in the image viewer}
  92.  
  93.         DDETerminate(ChanNum1)
  94.         DDEExecute(ChanNum,"[CloseDatabase]",Res)
  95.         DrawBackground
  96.     Endif
  97.     Goto Wait_for_Input
  98.  
  99. Test_MSAccess:
  100.     DrawBackground
  101.     If ChanNum <> 0 Then DDETerminate(ChanNum)
  102.     DDEInitiate("MSAccess","System",ChanNum)
  103.     If ChanNum = 0 
  104.         DrawText(10,10,"DDE initiate failed")
  105.         DrawText(10,25,"Access may need to be started.")
  106.     Else
  107.         DrawText(10,10,"DDE conversation initiated")
  108.  
  109.         DDERequest(ChanNum,"Topics",Res$)
  110.         If Res$ = "" Then Beep Res$ = "No Items listed"
  111.         MessageBox(OK,1,INFORMATION,Res$,"Access 'Topics' Items",Res)
  112.  
  113.         DDERequest(ChanNum,"SysItems",Res$)
  114.         If Res$ = "" Then Beep Res$ = "No Items listed"
  115.         MessageBox(OK,1,INFORMATION,Res$,"Excel 'SysItems' Items",Res)
  116.  
  117.         DDERequest(ChanNum,"Formats",Res$)
  118.         If Res$ = "" Then Beep Res$ = "No Items listed"
  119.         MessageBox(OK,1,INFORMATION,Res$,"Access 'Formats' Items",Res)
  120.  
  121.         DDERequest(ChanNum,"Status",Res$)
  122.         If Res$ = "" Then Beep Res$ = "No Items listed"
  123.         MessageBox(OK,1,INFORMATION,Res$,"Access 'Status' Items",Res)
  124.  
  125.     Endif
  126.     Goto Wait_for_Input
  127.  
  128. Test_MSExcel:
  129.     DrawBackground
  130.     If ChanNum <> 0 Then DDETerminate(ChanNum)
  131.     DDEInitiate("Excel","System",ChanNum)
  132.     If ChanNum = 0 
  133.         DrawText(10,10,"DDE initiate failed")
  134.     Else
  135.         DrawText(10,10,"DDE conversation initiated")
  136.         DDERequest(ChanNum,"Formats",Res$)
  137.         If Res$ = "" Then Beep Res$ = "No Items listed"
  138.         MessageBox(OK,1,INFORMATION,Res$,"Excel 'Formats' Items",Res)
  139. {
  140.         DDERequest(ChanNum,"Help",Res$)
  141.         If Res$ = "" Then Beep Res$ = "No Items listed"
  142.         MessageBox(OK,1,INFORMATION,Res$,"Excel 'Help' Items",Res)
  143. }
  144.         DDERequest(ChanNum,"Status",Res$)
  145.         If Res$ = "" Then Beep Res$ = "No Items listed"
  146.         MessageBox(OK,1,INFORMATION,Res$,"Excel 'Status' Items",Res)
  147. {
  148.         DDERequest(ChanNum,"ReturnMessage",Res$)
  149.         If Res$ = "" Then Beep Res$ = "No Items listed"
  150.         MessageBox(OK,1,INFORMATION,Res$,"Excel 'ReturnMessage' Items",Res)
  151. }
  152.         DDERequest(ChanNum,"SysItems",Res$)
  153.         If Res$ = "" Then Beep Res$ = "No Items listed"
  154.         MessageBox(OK,1,INFORMATION,Res$,"Excel 'SysItems' Items",Res)
  155. {
  156.         DDERequest(ChanNum,"TopicItemList",Res$)
  157.         If Res$ = "" Then Beep Res$ = "No Items listed"
  158.         MessageBox(OK,1,INFORMATION,Res$,"Excel 'TopicItemList' Items",Res)
  159. }
  160.         DDERequest(ChanNum,"Topics",Res$)
  161.         If Res$ = "" Then Beep Res$ = "No Items listed"
  162.         MessageBox(OK,1,INFORMATION,Res$,"Excel 'Topics' Items",Res)
  163.  
  164.         DDERequest(ChanNum,"Selection",Res$)
  165.         If Res$ = "" Then Beep Res$ = "No Items listed"
  166.         MessageBox(OK,1,INFORMATION,Res$,"Excel 'Selection' Items",Res)
  167.  
  168.         DDERequest(ChanNum,"Protocols",Res$)
  169.         If Res$ = "" Then Beep Res$ = "No Items listed"
  170.         MessageBox(OK,1,INFORMATION,Res$,"Excel 'Protocols' Items",Res)
  171.  
  172.         DDERequest(ChanNum,"EditEnvItems",Res$)
  173.         If Res$ = "" Then Beep Res$ = "No Items listed"
  174.         MessageBox(OK,1,INFORMATION,Res$,"Excel 'EditEnvItems' Items",Res)
  175.     
  176.         DDETerminate(ChanNum)
  177.         DDEInitiate("Excel","[Book1]Sheet1",ChanNum)
  178.         DDERequest(ChanNum,"R1C1",Res$)
  179.         If Res$ = "" Then Beep Res$ = "No Items listed"
  180.         MessageBox(OK,1,INFORMATION,Res$,"Excel cell contents",Res)
  181.     
  182.         DDEPoke(ChanNum,"R1C2","More blah",Res)
  183.         DDERequest(ChanNum,"R1C2",Res$)
  184.         If Res$ = "" Then Beep Res$ = "No Items listed"
  185.         MessageBox(OK,1,INFORMATION,Res$,"Excel cell contents",Res)
  186.  
  187.     Endif
  188.     Goto Wait_for_Input
  189.  
  190.  
  191.  
  192. Start_Explorer_DDE: 
  193.     DrawBackground
  194.     If ChanNum <> 0 Then DDETerminate(ChanNum)
  195.     DDEInitiate("Folders","AppProperties",ChanNum)
  196.     If ChanNum = 0 
  197.         DrawText(10,10,"DDE initiate failed")
  198.     Else
  199.         DrawText(10,10,"DDE conversation initiated")
  200.         ChangeMenuItem("&DDE Init",GRAY,Res)
  201.         ChangeMenuItem("&FindFolder",ENABLE,Res)
  202.         ChangeMenuItem("F&indFile",ENABLE,Res)
  203.         ChangeMenuItem("&ExploreFolder",ENABLE,Res)
  204.         ChangeMenuItem("&ViewFolder",ENABLE,Res)
  205.     Endif
  206.     Goto Wait_for_Input
  207.  
  208. Requests_DDE:
  209.         DrawText(10,10,"DDE conversation initiated")
  210.         DDERequest(ChanNum,"Formats",Res$)
  211.         If Res$ = "" Then Beep Res$ = "No Items listed"
  212.         MessageBox(OK,1,INFORMATION,Res$,"Explorer 'Formats' Items",Res)
  213.  
  214.         DDERequest(ChanNum,"Help",Res$)
  215.         If Res$ = "" Then Beep Res$ = "No Items listed"
  216.         MessageBox(OK,1,INFORMATION,Res$,"Explorer 'Help' Items",Res)
  217.  
  218.         DDERequest(ChanNum,"Status",Res$)
  219.         If Res$ = "" Then Beep Res$ = "No Items listed"
  220.         MessageBox(OK,1,INFORMATION,Res$,"Explorer 'Status' Items",Res)
  221.  
  222.         DDERequest(ChanNum,"ReturnMessage",Res$)
  223.         If Res$ = "" Then Beep Res$ = "No Items listed"
  224.         MessageBox(OK,1,INFORMATION,Res$,"Explorer 'ReturnMessage' Items",Res)
  225.  
  226.         DDERequest(ChanNum,"SysItems",Res$)
  227.         If Res$ = "" Then Beep Res$ = "No Items listed"
  228.         MessageBox(OK,1,INFORMATION,Res$,"Explorer 'SysItems' Items",Res)
  229.  
  230.         DDERequest(ChanNum,"TopicItemList",Res$)
  231.         If Res$ = "" Then Beep Res$ = "No Items listed"
  232.         MessageBox(OK,1,INFORMATION,Res$,"Explorer 'TopicItemList' Items",Res)
  233.  
  234.         DDERequest(ChanNum,"Topics",Res$)
  235.         If Res$ = "" Then Beep Res$ = "No Items listed"
  236.         MessageBox(OK,1,INFORMATION,Res$,"Explorer 'Topics' Items",Res)
  237.  
  238.         DDERequest(ChanNum,"Selection",Res$)
  239.         If Res$ = "" Then Beep Res$ = "No Items listed"
  240.         MessageBox(OK,1,INFORMATION,Res$,"Explorer 'Selection' Items",Res)
  241.  
  242.         DDERequest(ChanNum,"Protocols",Res$)
  243.         If Res$ = "" Then Beep Res$ = "No Items listed"
  244.         MessageBox(OK,1,INFORMATION,Res$,"Explorer 'Protocols' Items",Res)
  245.  
  246.         DDERequest(ChanNum,"EditEnvItems",Res$)
  247.         If Res$ = "" Then Beep Res$ = "No Items listed"
  248.         MessageBox(OK,1,INFORMATION,Res$,"Explorer 'EditEnvItems' Items",Res)
  249.     
  250.     Goto Wait_for_Input
  251.  
  252. FindFolder_DDE: {display the Find: All Files dialog from explorer}
  253.     {
  254.       DDEexec = [FindFolder("%l", %I)]
  255.       arg#1 = the start-in [path]directory string, no spaces; quotes not needed
  256.       arg#2 = string. If different from arg#1, takes precedence,
  257.                      appears in the 'LookIn' edit control
  258.     }
  259.     UseCursor(WAIT)
  260.     DDEExecute(ChanNum,"[FindFolder( ,c:\windows\system  )]",Res)
  261.     If Res = 0 Then DrawText(10,25,"DDE Exec failed.") 
  262.     UseCursor(ARROW)
  263.     Goto Wait_for_Input
  264.  
  265.  
  266. ExploreFolder_DDE:  {display the Find: All Files dialog from explorer. }
  267.     {
  268.  
  269.       arg#1 = [path]directory; 
  270.       arg#2 =  unknown
  271.       arg#3 = 0 | 1  ->Explorer window not visible | visible
  272.     }
  273.     UseCursor(WAIT)
  274.     DDEExecute(ChanNum,"[ExploreFolder(c:\windows\system, , 1)]",Res)
  275.     If Res = 0 Then DrawText(10,25,"DDE Exec failed.") 
  276.     UseCursor(ARROW)
  277.     Goto Wait_for_Input
  278.  
  279.  
  280. ViewFolder_DDE:  {display the Find: All Files dialog from explorer. }
  281.     {arg#1 = [path]directory; 
  282.       arg#2 =  unknown at present. string ?
  283.       arg#3 = 0 ->Explorer not visible, 1-> explorer visible
  284.     }
  285.     UseCursor(WAIT)
  286.     DDEExecute(ChanNum,"[ViewFolder(c:\windows\system, 0, 1)]",Res)
  287.     If Res = 0 Then DrawText(10,25,"DDE Exec failed.") 
  288.     UseCursor(ARROW)
  289.     Goto Wait_for_Input
  290.  
  291.  
  292. FindFile_DDE: {display the Find: All Files dialog from explorer}
  293.     {arg#1 =  start-in directory string, has to be valid directory eg \ 
  294.         on the C: drive. Don't seem able to set the start disk
  295.         to any other disk.
  296.       arg#2 = some number ?
  297.     }
  298.     UseCursor(WAIT)
  299.     DDEExecute(ChanNum,"[OpenFindFile(\,0)]",Res)
  300.     If Res = 0 Then DrawText(10,25,"DDE Exec failed.") 
  301.     UseCursor(ARROW)
  302.     Goto Wait_for_Input
  303.  
  304. {
  305. Notes on Explorer and DDE, after poking through the Registry.
  306.  
  307. Directory.shell
  308. ->command = C:\WINDOWS\Explorer.exe
  309. ->DDEexec = [FindFolder("%l", %I)]
  310.    -> application = Folders        This is the DDE Service name.
  311.    -> topic = AppProperties
  312.  
  313. arg#1 = start directory string, "" means string or Item ?
  314. arg#2 = unknown, suspect integer value
  315.  
  316.  
  317.  
  318. Drive.shell.find
  319. ->command = C:\WINDOWS\Explorer.exe
  320. ->DDEexec = [FindFolder("%l", %I)]
  321.    -> application = Folders
  322.    -> topic = AppProperties
  323.  
  324. findfile.shell.open
  325. ->command = C:\WINDOWS\Explorer.exe
  326. ->DDEexec = [OpenFindFile("%1", %I)]
  327.    -> application = Folders
  328.    -> topic = AppProperties
  329.  
  330.  
  331.  
  332. Folder.Shell.Explore:
  333. ->command = C:\WINDOWS\Explorer.exe /e,/idlist,%I,%L
  334. ->DDE exec = [ExploreFolder("%l", %I, %S)] 
  335.    -> application = Folders
  336.    -> topic = AppProperties
  337.  
  338. Folder.Shell.Open
  339. ->command = C:\WINDOWS\Explorer.exe /idlist,%I,%L
  340.     
  341. %L has to be a directory
  342.  
  343. ->DDEexec = [ViewFolder("%l", %I, %S)]
  344.    -> application = Folders
  345.    -> topic = AppProperties
  346. }
  347.